package cn.ffcs.util;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

import cn.ffcs.util.converter.DateUtil;

/**
 * 
 * 字典类型DAO实现<br/> <table>
 * <tr>
 * <td>负责人/principal: </td>
 * <td colspan="2">liuzhh</td>
 * <tr>
 * <td>修改记录/revision:</td>
 * <td colspan="2"></td>
 * </tr>
 * <tr>
 * <td>日期:</td>
 * <td>修改人:</td>
 * <td>修改说明:</td>
 * </tr>
 * <tr>
 * <td></td>
 * <td></td>
 * <td></td>
 * </tr>
 * </table>
 * @author g.huangjx
 * @version $Id$
 */
public class Test
{
    public String getTest(int i,String b){
        return i*2+b;
    }
    public List getList(int a,double b,Integer c,String aa){
        List ls=new ArrayList();
        ls.add(a);
        ls.add(b);
        ls.add(c);
        ls.add(aa);
       return ls;
    }
    @SuppressWarnings("deprecation")
	public static void main(String[] args) {
    	DateFormat df=new SimpleDateFormat("yyyy-MM-dd");
    	Calendar c = Calendar.getInstance();    
    	  
    	c.add(Calendar.MONTH, 1); // 目前時間加1個月 
    	try {
			Date date=df.parse(df.format(c.getTime()));
			System.out.println(date);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    	Date d=new Date();
    	System.out.println(DateUtil.dateToStr(d, "yyyy-MM-dd"));
    	d.setMonth(d.getMonth()+3);
    	System.out.println(DateUtil.dateToStr(d, "yyyy-MM-dd"));
    	d.setMonth(d.getMonth()+7);
    	System.out.println(DateUtil.dateToStr(d, "yyyy-MM-dd"));
    	String a="2010-03-22";
    	String yyyy=a.substring(0,4);
    	System.out.println(yyyy);
	}
}
